package ooday09;



    //学生类的测试类
    public class StudentTest {
        public static void main(String[] args) {
             class Student {
                //成员变量
                String name;
                int age;
                String address;

                //方法
                void study(){
                    System.out.println(name+"在学习...");
                }
                void sayHi(){
                    System.out.println("大家好，我叫"+name+"，今年"+age+"岁了，家住"+address);
                }
            }
            //创建学生对象
            Student zs = new Student();
            //访问成员变量
            zs.name = "zhangsan";
            zs.age = 24;
            zs.address = "河北廊坊";
            //调用方法
            zs.study();
            zs.sayHi();

            Student ls = new Student();
            ls.name = "lisi";
            ls.age = 26;
            ls.address = "黑龙江佳木斯";
            ls.study();
            ls.sayHi();

            //1)创建了一个学生对象
            //2)给成员变量赋默认值
            Student ww = new Student();
            ww.study();
            ww.sayHi();

        }
    }
